<script setup>
import { computed } from "vue";
import { useLayoutThemeStore } from "@/store/layout/layoutTheme.js";

defineProps({
  collapsed: {
    type: Boolean,
  },
});

const layoutThemeStore = useLayoutThemeStore();
const layoutSetting = layoutThemeStore.layoutSetting;
const title = computed(() => layoutSetting.title);
const titleColor = computed(() => layoutThemeStore.titleColor);

const style = computed(() => {
  return {
    paddingLeft: "10px",
    height: `var(--app-header-height)`,
    color: titleColor.value,
  };
});
</script>

<template>
  <div
    class="flex-cc overflow-hidden whitespace-nowrap font-500 text-20px"
    :style="style"
  >
    <img
      v-if="collapsed"
      class="w40px mr8px"
      src="~@/assets/images/square_icon.png"
      alt=""
    />
    <img v-else class="w120px mr8px" src="~@/assets/images/ic_byfen_logo.png" alt="" />
    <div
      v-show="!collapsed"
      style="
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      "
    >
      {{ title }}
    </div>
  </div>
</template>

<style lang="less" scoped></style>
